package com.tanhua.locationmanager.interceptors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * mvcconfig
 * 因为静态页面没有部署在nginx上，所以暂时不可以使用拦截器，所以Configuration注解是注释状态
 * @author Huo
 * @date 2021/07/18 11:07:53
 */
@Configuration
public class MVCConfig implements WebMvcConfigurer {

    @Autowired
    private TokenInterceptor tokenInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tokenInterceptor)
                .addPathPatterns("/**")  //拦截所有的请求
                .excludePathPatterns("/login/passwordLogin","/login/wechatlogin","/login/faceLogin","/login/verification","/login/wechatBind");
    }
}
